This invention relates generally to the field of virtualized environments, and more particularly to opportunistic evaluation of programs in virtualized environments.
Generally, evaluation strategies determine when code should be put into a processor queue to be turned into a value. Execution strategies take code from the processor queue and determine the best way to execute the code by CPUs. Two common strategies used by programming languages for evaluating programs include strict and delayed evaluation. Strict evaluation evaluates expressions immediately and returns the result whereas delayed evaluation returns a “promise” to evaluate the expression later. A promise encapsulates everything that is needed to perform the computation at a later time. As an entire program is evaluated, promises can stack up and be nested in a tree that corresponds to the structure of the program. When the evaluation reaches the point that an actual value is required, then a special operation referred to as “force” is used. The force operator causes the computation contained within the promise to be evaluated. In instances where an expression contains many or nested promises, multiple force operations may be required to obtain a final value.